require File.expand_path(File.dirname(__FILE__) + '/util')

class DesktopUpdater
  def initialize
    @desktop_updaters = []
    Dir.glob(File.join("desktop", "*.rb")) do |filename|
      require filename
      aclass = eval(extract_class_name(filename))
      @desktop_updaters << aclass.new
    end
  end

  def do_update context
    @desktop_updaters.each {|u| u.do_update context}
  end
  
  private 
  def extract_class_name filename
    File.basename(filename)[0..-4]
  end
end